import { createApp } from 'vue';
import { configureCompat } from '@vue/compat';
import App from './App.vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import router from '@/router';
import './styles/common.scss';
import VueClipboard from 'vue-clipboard2';

// 配置兼容模式
configureCompat({
  MODE: 'Vue2'
});

const app = createApp(App);

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(router);
app.use(ElementPlus, { locale: zhCn });
VueClipboard.config.autoSetContainer = true; // add this line
app.use(VueClipboard);
app.mount('#app');
